<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = dateFormat.format(new Date());
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
    <link type="text/css" rel="stylesheet" href="<%=basePath %>statics/css/common/common-1.0.css">
    <link type="text/css" rel="stylesheet" href="<%=basePath %>statics/js/plug/jqueryUI/jquery-ui.css">
    <link type="text/css" rel="stylesheet" href="<%=basePath%>statics/js/plug/jqPaginator/jqPaginator.css"/>
    <link type="text/css" rel="stylesheet" href="<%=basePath %>statics/css/base/baselog/base_log.css">
    <script type="text/javascript" src="<%=basePath %>statics/js/plug/jquery-1.12.0.min.js"></script>
    <%-- <script type="text/javascript" src="<%=basePath %>statics/js/common/common.js"></script> --%>
    <script type="text/javascript" src="<%=basePath%>statics/js/common/common-1.0.js"></script>
    <script type="text/javascript" src="<%=basePath %>statics/js/plug/jqueryUI/jquery-ui.js"></script>
    <!-- jqPaginator -->
    <script type="text/javascript" src="<%=basePath%>statics/js/plug/jqPaginator/jqPaginator.js"></script>
    <script type="text/javascript" src="<%=basePath %>statics/js/base/baselog/base_log_list.js"></script>
    <!-- 引入时间控件 -->
	<script type="text/javascript" src="<%=basePath%>statics/js/My97DatePicker/WdatePicker.js" defer ="defer"></script>
    <!-- jbox提示框-->
    <link type="text/css" rel="stylesheet" href="<%=basePath%>statics/js/plug/jbox/jBox.css"/>
    <script type="text/javascript" src="<%=basePath %>statics/js/plug/jbox/jBox.js"></script>
    <!-- 引入多行输入控件 -->
    <script type="text/javascript" src="<%=basePath%>statics/js/ckeditor/ckeditor.js"></script>
    <!-- jquery 验证-->
    <script type="text/javascript" src="<%=basePath %>statics/js/plug/jquery.validate.min.js"></script>
    <script type="text/javascript">
        var pageNumber = ${page.pageNumber};
        var totalCount = ${page.totalCount};
        var pageSize = ${page.pageSize};
    </script>
</head>
<body style="width: 100%;height: 100%;">

	<div class="table_search_div">
        <form id="searchForm" action="">
	         <table>
	        	<tr>
	        	  <td><span>操作用户名:</span></td>
	        	  <td> <input type="text" name="userName" value="${logBean.userName}"></td>
	        	  <td><span>操作时间从:</span></td>
	        	  <td>
	            	 <input name="startOperateTimeStr" type="text" id="startOperateTimeStr" 
	            	  onFocus=
	            		  "WdatePicker({maxDate:'#F{$dp.$D(\'endOperateTimeStr\')||\'2050-10-01\'}',dateFmt:'yyyy/MM/dd'})" 
	            	  value="${logBean.startOperateTimeStr}"/>至
	            	 <input name="endOperateTimeStr"  type="text" id="endOperateTimeStr"
				      onFocus=
				    	  "WdatePicker({minDate:'#F{$dp.$D(\'startOperateTimeStr\')}',dateFmt:'yyyy/MM/dd'})" 
				      value="${logBean.endOperateTimeStr}"/>
	              </td>
	              <td><button id="searchBtn" onfocus="this.blur()">查询</button></td>
	        	</tr>
	         </table>
        </form>
    </div>
    <div class="table_title_div">
       <span>系统日志</span>   
    </div>
    <shiro:hasPermission name="log:view">
      <div class="table_list_div">
            <table id="logTable" cellspacing='0' width='100%'>
                <tr>                    
                    <th style="width: 10%">序号</th>
                    <th style="width: 15%">用户名</th>
                    <th style="width: 15%">IP</th>
                    <th style="width: 30%">操作内容</th>
                    <th style="width: 25%">时间</th>
                </tr>
                <c:forEach var="logPage" items="${page.items}" varStatus="status">
                    <tr>
                        <td>${status.count}</td>
                        <td>${logPage.userName}</td>
                        <td>${logPage.ip}</td>
                        <td>${logPage.userMessage}</td>
                        <td>${logPage.time}</td>                      
                    </tr>
                </c:forEach>

				<c:if test="${lastCount > 0}">
                	<c:forEach begin="1" end="${lastCount}" step="1" varStatus="status">
	                     <tr <c:if test="${status.count%2==0}"> bgcolor="#ffffff" </c:if> >
	                       <td>&nbsp;</td>
	                       <td>&nbsp;</td>
	                       <td>&nbsp;</td>
	                       <td>&nbsp;</td>
	                       <td>&nbsp;</td>
	                    </tr>
                	</c:forEach>
                </c:if>
               <%--  <c:if test="${page.totalCount==0}">
                	<tr>
                		<td colspan="8" align="center">无记录</td>
                	</tr>
                </c:if> --%>
            </table>
            <div class="paginationDiv">
                <ul class="pagination" id="pagination"></ul>
            </div>
        </div>
    </shiro:hasPermission>
    
</body>
</html>